<?php

namespace App\Models;

class Event extends Model
{
    protected $fillable = [
        'event_status',
        'feedback'
    ];
    protected $table = 'event';

    public function housings()
    {
        return $this->hasOne(Housings::class,'id','housings_id');
    }
    protected $eventType=[1=>'网约房管理',2=>'住客投诉', 3=>'巡检问题'];
    protected $eventStatus=[1=>'已通过',2=>'未通过', 3=>'已结办',4=>'未结办'];
    public function getEventTypeAttribute($value)
    {
        return isset($this->eventType[$value]) ? $this->eventType[$value] : reset($this->eventType);
    }

    public function getEventStatusAttribute($value)
    {
        return isset($this->eventStatus[$value]) ? $this->eventStatus[$value] : reset($this->eventStatus);
    }
}
